package com.liveneo.adapter.base.filter;

import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import com.liveneo.adapter.base.support.AdapterConstants;
import com.liveneo.adapter.base.support.ThreadStore;

/**
 * cxf接口监听(调用开始)
 * 
 * @author fucy
 *
 */
public class ClaimCxfInInterceptor extends AbstractPhaseInterceptor<Message> {
    public ClaimCxfInInterceptor(String phase) {
        super(phase);
    }

    public ClaimCxfInInterceptor() {
        super(Phase.PRE_INVOKE);
    }

    @Override
    public void handleMessage(Message message) throws Fault {
        // 请求类型记录为cxf，主要用于记录日志时类型识别
        ThreadStore.setCurRequestType(AdapterConstants.MODULE_TYPE_CXF);
    }
}
